﻿@model Web
@{
    Layout = "~/Views/Shared/_Dashboard.cshtml";
}
@UIHelper.ImageTitle(Html.Global("CreateTeamSite_Title"), Html.Global("CreateTeamSite_Desc"), "~/content/images/icon_gears2_48.png")
<table>
    <tr>
        <td style="width: 200px; vertical-align: top; text-align: center;">
            @{
                Package _pkg = ViewBag.Package;
                var _img = _pkg.Images.FirstOrDefault();
            }
            @if (_img != null)
            {
                <img src="@_pkg.ResolveUrl(_img.Url)" alt="@_pkg.Title" />
            }
        </td>
        <td style="vertical-align: top;">
            @UIHelper.PackageInfo(_pkg)
        </td>
    </tr>
</table>
<hr />
@using (Html.BeginForm())
{
    <input type="hidden" value="@User.Identity.Name" name="Web.Owner" />
    <table class="d-field-table">
        <tr>
            <td colspan="2">
                @Html.ValidationSummary()
            </td>
        </tr>
        <tr>
            <td>
                <h3 class="d-field-title">
                    <label for="Web_NAME">
                        @Html.Global("RES_NAME")
                    </label>
                </h3>
                <div class="d-field-description">
                    @Html.Global("CreateSite_Name_Tips")
                </div>
            </td>
            <td>
                @Ajax.DnaFor().TextBox(m => m.Name).Width(300).GetHtml()
            </td>
        </tr>
        <tr>
            <td>
                <h3 class="d-field-title">
                    <label for="Web_Title">
                        @Html.Global("RES_TITLE")
                    </label>
                </h3>
                <div class="d-field-description">
                    @Html.Global("RES_WEBSITE_TITLE_TIPS")
                </div>
            </td>
            <td>
                @Ajax.DnaFor().TextBox(m => m.Title).Width(300).GetHtml()
            </td>
        </tr>
        <tr>
            <td>
                <h3 class="d-field-title">@Html.Global("RES_THEME")
                </h3>
                <div class="d-field-description">
                    @Html.Global("CreateSite_Theme_Tips")
                </div>
            </td>
            <td>
                @(Ajax.Dna().ComboBox("Web.Theme")
                    .Bind(WebSiteContext.Current.DataContext.Themes.All().Select(p => p.Name).ToArray())
                    .Select("default")
                    .DropDownList()
                    .GetHtml())
            </td>
        </tr>
        <tr>
            <td>
                <h3 class="d-field-title">
                    <label for="Web_Description">
                        @Html.Global("RES_DESC")</label></h3>
                <div class="d-field-description">
                    @Html.Global("RES_WEBSITE_DESC_TIPS")
                </div>
            </td>
            <td>
                @Ajax.DnaFor().TextArea(m => m.Description).Width(300).Resizable().GetHtml()
            </td>
        </tr>
    </table>
    <hr />
    <div style="text-align: center;">
        @Ajax.Dna().Button().LocText("RES_SAVE").ImageIcons(Url.Content("~/content/images/icon_save.gif")).Submit().GetHtml()
    </div>
}